<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix='c' %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Welcome to inventory DB</title>
</head>
<jsp:useBean id="disabled" class="ac.il.technion.cs236369.hw5.core.bean.CheckDisabledBean" scope="page">
	<jsp:setProperty name="disabled" property="userLogin" value="<%= request.getUserPrincipal( ).getName() %>" />
</jsp:useBean>
<body>
	<%
		if ( !disabled.isDisabled( )) {
			if  (request.isUserInRole( "manager")) { 
		%>
			<jsp:forward page="admin.jsp" />
		<% 	} else {
		%>
			<jsp:forward page="user.jsp" />
		<%
			}
		} else {
			session.invalidate( );
	%>
		<jsp:forward page="/error.html" />
	<%
		}
	%>
	
</body>
</html>